<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>判断一个数是偶数还是奇数</title>
</head>

<body>
    <script>
        var a = 66;
        a = Number(a);
        if (!isNaN(a)) {
            if (a % 2 == 0) {
                console.log(a + "是偶数");
            } else {
                console.log(a + "是奇数");
            }
        }else{
            console.log('请输入合法数字');
        }

    </script>
</body>

</html>